package com.qqtech.qquan.activity.service;

import java.util.List;

import com.qqtech.core.common.exception.OrderException;
import com.qqtech.core.frame.model.Result;
import com.qqtech.core.frame.service.BaseService;
import com.qqtech.qquan.activity.model.ActivitySign;
import com.qqtech.qquan.activity.model.ActivitySignVo;

public interface ActivitySignService extends BaseService<ActivitySign> {

	/**
	 * 用户报名
	 * 
	 * @param id
	 * @return
	 * @throws OrderException
	 */
	Result handleSign(Integer buyerId, ActivitySign activitySign) throws OrderException;
	
	/**
	 * 是否已经报名
	 * 
	 * @param userId
	 * @param activityId
	 * @return
	 */
	boolean isSign(Integer userId, Integer activityId);
	
	/**
	 * 取消报名
	 * 
	 * @param userId
	 * @param activityId
	 * @return
	 */
	int handleCancle(Integer userId, Integer activityId);

	/**
	 * 活动报名人数
	 * 
	 * @param activityId
	 * @return
	 */
	int getSignCount(Integer activityId);
	
	/**
	 * 根据订单号，获得报名记录
	 * 
	 * @param orderNo
	 * @return
	 */
	ActivitySignVo getSignByOrderNo(String orderNo);

	/**
	 * 是否首次参加活动
	 * @param userId
	 * @return
	 */
	boolean isFirstSignActivity(Integer userId);

	/**
	 * 查询用户最近报名活动记录
	 * @param userId
	 * @param some
	 * @return
	 */
	List<ActivitySignVo> myLastSomeSigns(Integer userId, Integer some);

	Integer getCountByUserId(Integer userId);
}